package top.wugy.blog.model;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.IBean;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Record;
import top.wugy.blog.kits.Const;

import java.util.List;

/**
 * wugy on 2017/11/9 11:27
 */
public class TLink extends Model<TLink> implements IBean {

    public static final TLink dao = new TLink();

    public TLink setId(Integer id) {
        return set("id", id);
    }

    public Integer getId() {
        return get("id");
    }

    public TLink setTitle(String title) {
        return set("title", title);
    }

    public String getTitle() {
        return get("title");
    }

    public TLink setUrl(String url) {
        return set("url", url);
    }

    public String getUrl() {
        return get("url");
    }

    public List<Record> findAll() {
        return Db.find("select * from " + Const.TABLE_LINK + " order by id desc");
    }
}
